package com.jilintongyi.jlcrtvu.service.impl;

import java.util.Map;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 * 基础服务类
 */
public class BaseServiceImpl {
	@PersistenceContext
	public EntityManager entityManager;

	/**
	 * 设置查询参数
	 * 
	 * @param query
	 * @param params
	 */
	public void setParameters(Query query, Map<String, Object> params) {
		for (Map.Entry<String, Object> entry : params.entrySet()) {
			query.setParameter(entry.getKey(), entry.getValue());
		}
	}
}
